using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
namespace BusinessObjects.BO_GetObjects {
    public static class BO_portal_sms {
        public static DataTable SelectAll(int status) {
            try {
                usp_portal_sms_select_all entity = new usp_portal_sms_select_all();
                entity.STATUS = status;
                return BO_Actions<usp_portal_sms_select_all>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable SelectTop(int rows, int status) {
            try {
                usp_portal_sms_select_top entity = new usp_portal_sms_select_top();
                entity.NUMBERRECORD = rows;
                entity.STATUS = status;
                return BO_Actions<usp_portal_sms_select_top>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable Search(int sms_id) {
            try {
                usp_portal_sms_search entity = new usp_portal_sms_search();
                entity.SMS_ID = sms_id;

                return BO_Actions<usp_portal_sms_search>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable SelectWithPaged(int startIndex, int pageCount, int status) {
            try {
                usp_portal_sms_select_paged entity = new usp_portal_sms_select_paged();
                entity.STARTINDEX = startIndex;
                entity.MAXRECORDS = pageCount;
                entity.STATUS = status;
                return BO_Actions<usp_portal_sms_select_paged>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static string Insert(int service_id, string user_id, string command_code, string sms_content, string request_id, string Operator, string return_content, DateTime created_date, int status) {
            try {
                usp_portal_sms_insert entity = new usp_portal_sms_insert();
                entity.SERVICE_ID = service_id;
                entity.USER_ID = user_id;
                entity.COMMAND_CODE = command_code;
                entity.SMS_CONTENT = sms_content;
                entity.REQUEST_ID = request_id;
                entity.OPERATOR = Operator;
                entity.RETURN_CONTENT = return_content;
                entity.CREATED_DATE = created_date;
                entity.STATUS = status;

                return BO_Actions<usp_portal_sms_insert>.ExecuteAndReturnStringValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static string Update(Int64 sms_id, int service_id, string user_id, string command_code, string sms_content, string request_id, string Operator, string return_content, DateTime created_date, int status) {
            try {
                usp_portal_sms_update entity = new usp_portal_sms_update();
                entity.SMS_ID = sms_id;
                entity.SERVICE_ID = service_id;
                entity.USER_ID = user_id;
                entity.COMMAND_CODE = command_code;
                entity.SMS_CONTENT = sms_content;
                entity.REQUEST_ID = request_id;
                entity.OPERATOR = Operator;
                entity.RETURN_CONTENT = return_content;
                entity.CREATED_DATE = created_date;
                entity.STATUS = status;

                return BO_Actions<usp_portal_sms_update>.ExecuteAndReturnStringValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static bool Delete(string ids, string spliter, int delete_type) {
            try {
                usp_portal_sms_delete entity = new usp_portal_sms_delete();
                entity.IDS = ids;
                entity.SPLITER = spliter;
                entity.DELETE_TYPE = delete_type;

                return BO_Actions<usp_portal_sms_delete>.ExecuteAndReturnBooleanValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static bool Restore(int sms_id) {
            try {
                usp_portal_sms_restore entity = new usp_portal_sms_restore();
                entity.SMS_ID = sms_id;

                return BO_Actions<usp_portal_sms_restore>.ExecuteAndReturnBooleanValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable SelectAdmin(int startIndex, int pageCount, int service_id, string keywords) {
            try {
                usp_portal_sms_select_admin entity = new usp_portal_sms_select_admin();
                entity.STARTINDEX = startIndex;
                entity.MAXRECORDS = pageCount;
                entity.SERVICE_ID = service_id;
                entity.KEYWORDS = keywords;
                return BO_Actions<usp_portal_sms_select_admin>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
    }
}

